<?php
require_once("taskpointView.php");
require_once(CORE_DIR.'taskpointModel.php');

class getuserpointsAction extends authAction{

	function __construct(){
		$this->view = new taskpointView();
	}

	public function run($get, $post, $viewtype) {
		parent::run($get,$post,$viewtype);
		
		$tpModel = new taskpointModel();	 	
		
		if ( isset($get["userid"]))
		{
			$userId = $get["userid"];
			
			$userPoints = $tpModel->getUserPoints($userId);
		
			$this->view->setProperty("userPoints", $userPoints);
			$this->view->showGetUserPoints();
		}
		else
		{
			$this->view->showBadCmd();
		}
		
	}
}
?>